package com.lmind.gps.t;

import java.io.Serializable;

public class RmiClient {
	
	private RmiServer server;

	public RmiServer getServer() {
		return server;
	}

	public void setServer(RmiServer server) {
		this.server = server;
	}
	
	public void callNoReturn() {
		System.out.println("call noReturn");
		server.noReturn("12345");
	}

	public void callHasReturn() {
		System.out.println("call hasReturn");
		server.hasReturn("123456");
	}
	
	public void addCallback() {
		server.addCallback(new Callback());
	}
	
	public void callCallback() {
		System.out.println("call Callback");
		server.callback("123456");
	}
	
	public static class Callback implements RmiCallback, Serializable {
		@Override
		public void call(String name) {
			System.out.println("callback return " + name);
		}
	}
}
